/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('aiccs', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddBlacklistRequest {
  expiredDay?: string(name='ExpiredDay', description='有效天数

This parameter is required.', example='1'),
  numbers?: [ string ](name='Numbers', description='号码列表

This parameter is required.'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='备注

This parameter is required.', example='示例值'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model AddBlacklistShrinkRequest {
  expiredDay?: string(name='ExpiredDay', description='有效天数

This parameter is required.', example='1'),
  numbersShrink?: string(name='Numbers', description='号码列表

This parameter is required.'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='备注

This parameter is required.', example='示例值'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model AddBlacklistResponseBody = {
  code?: long(name='Code', example='0'),
  message?: string(name='Message', example='示例值示例值'),
  model?: {
    unHandleNumbers?: [ string ](name='UnHandleNumbers', description='错误手机号'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: string(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model AddBlacklistResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddBlacklistResponseBody(name='body'),
}

/**
 * @summary 添加黑名单接口
 *
 * @param tmpReq AddBlacklistRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddBlacklistResponse
 */
async function addBlacklistWithOptions(tmpReq: AddBlacklistRequest, runtime: Util.RuntimeOptions): AddBlacklistResponse {
  Util.validateModel(tmpReq);
  var request = new AddBlacklistShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.numbers)) {
    request.numbersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.numbers, 'Numbers', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.expiredDay)) {
    query['ExpiredDay'] = request.expiredDay;
  }
  if (!Util.isUnset(request.numbersShrink)) {
    query['Numbers'] = request.numbersShrink;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddBlacklist',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 添加黑名单接口
 *
 * @param request AddBlacklistRequest
 * @return AddBlacklistResponse
 */
async function addBlacklist(request: AddBlacklistRequest): AddBlacklistResponse {
  var runtime = new Util.RuntimeOptions{};
  return addBlacklistWithOptions(request, runtime);
}

model AddTaskRequest {
  callTimeList?: [ 
    {
      callTime?: [ string ](name='CallTime'),
    }
  ](name='CallTimeList', description='外呼时间'),
  callbackUrl?: string(name='CallbackUrl', description='回调地址', example='示例值示例值示例值'),
  flashSmsTemplateId?: long(name='FlashSmsTemplateId', description='当发送闪信配置为1时，闪信模板ID必填', example='96'),
  flashSmsType?: long(name='FlashSmsType', description='发送闪信配置', example='0'),
  maxConcurrency?: long(name='MaxConcurrency', description='并发数', example='99'),
  name?: string(name='Name', description='任务名称

This parameter is required.', example='示例值示例值示例值'),
  ownerId?: long(name='OwnerId'),
  playSleepVal?: long(name='PlaySleepVal', description='播放间隔时长', example='89'),
  playTimes?: long(name='PlayTimes', description='录音播放次数', example='51'),
  recallType?: long(name='RecallType', description='重呼配置', example='53'),
  recordPath?: string(name='RecordPath', description='录音地址', example='示例值'),
  repeatCount?: long(name='RepeatCount', description='重呼次数', example='37'),
  repeatInterval?: long(name='RepeatInterval', description='重呼间隔', example='14'),
  repeatReason?: [ string ](name='RepeatReason', description='重呼条件'),
  repeatTimes?: [ string ](name='RepeatTimes', description='重呼时间'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendSmsPlan?: [ 
    {
      intentTags?: [ string ](name='IntentTags', description='意向标签'),
      smsTemplateId?: long(name='SmsTemplateId', description='短信模板ID', example='71'),
    }
  ](name='SendSmsPlan', description='短信发送规则'),
  startTime?: string(name='StartTime', description='任务启动日期', example='2022-09-16'),
  taskType?: long(name='TaskType', description='任务类型

This parameter is required.', example='1'),
  templateId?: long(name='TemplateId', description='话术模板ID', example='17'),
  templateType?: long(name='TemplateType', description='话术模板类型', example='1'),
}

model AddTaskShrinkRequest {
  callTimeListShrink?: string(name='CallTimeList', description='外呼时间'),
  callbackUrl?: string(name='CallbackUrl', description='回调地址', example='示例值示例值示例值'),
  flashSmsTemplateId?: long(name='FlashSmsTemplateId', description='当发送闪信配置为1时，闪信模板ID必填', example='96'),
  flashSmsType?: long(name='FlashSmsType', description='发送闪信配置', example='0'),
  maxConcurrency?: long(name='MaxConcurrency', description='并发数', example='99'),
  name?: string(name='Name', description='任务名称

This parameter is required.', example='示例值示例值示例值'),
  ownerId?: long(name='OwnerId'),
  playSleepVal?: long(name='PlaySleepVal', description='播放间隔时长', example='89'),
  playTimes?: long(name='PlayTimes', description='录音播放次数', example='51'),
  recallType?: long(name='RecallType', description='重呼配置', example='53'),
  recordPath?: string(name='RecordPath', description='录音地址', example='示例值'),
  repeatCount?: long(name='RepeatCount', description='重呼次数', example='37'),
  repeatInterval?: long(name='RepeatInterval', description='重呼间隔', example='14'),
  repeatReasonShrink?: string(name='RepeatReason', description='重呼条件'),
  repeatTimesShrink?: string(name='RepeatTimes', description='重呼时间'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendSmsPlanShrink?: string(name='SendSmsPlan', description='短信发送规则'),
  startTime?: string(name='StartTime', description='任务启动日期', example='2022-09-16'),
  taskType?: long(name='TaskType', description='任务类型

This parameter is required.', example='1'),
  templateId?: long(name='TemplateId', description='话术模板ID', example='17'),
  templateType?: long(name='TemplateType', description='话术模板类型', example='1'),
}

model AddTaskResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: long(name='Code', example='0'),
  message?: string(name='Message', example='示例值'),
  model?: {
    taskId?: long(name='TaskId', description='任务ID', example='47'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='5453cc9b-02bc-4dbb-9527-f28a9100b912'),
  success?: boolean(name='Success', example='false'),
  timestamp?: long(name='Timestamp', example='1686225227338'),
}

model AddTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddTaskResponseBody(name='body'),
}

/**
 * @summary 创建任务接口
 *
 * @param tmpReq AddTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddTaskResponse
 */
async function addTaskWithOptions(tmpReq: AddTaskRequest, runtime: Util.RuntimeOptions): AddTaskResponse {
  Util.validateModel(tmpReq);
  var request = new AddTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.callTimeList)) {
    request.callTimeListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.callTimeList, 'CallTimeList', 'json');
  }
  if (!Util.isUnset(tmpReq.repeatReason)) {
    request.repeatReasonShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.repeatReason, 'RepeatReason', 'json');
  }
  if (!Util.isUnset(tmpReq.repeatTimes)) {
    request.repeatTimesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.repeatTimes, 'RepeatTimes', 'json');
  }
  if (!Util.isUnset(tmpReq.sendSmsPlan)) {
    request.sendSmsPlanShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sendSmsPlan, 'SendSmsPlan', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.callTimeListShrink)) {
    query['CallTimeList'] = request.callTimeListShrink;
  }
  if (!Util.isUnset(request.callbackUrl)) {
    query['CallbackUrl'] = request.callbackUrl;
  }
  if (!Util.isUnset(request.flashSmsTemplateId)) {
    query['FlashSmsTemplateId'] = request.flashSmsTemplateId;
  }
  if (!Util.isUnset(request.flashSmsType)) {
    query['FlashSmsType'] = request.flashSmsType;
  }
  if (!Util.isUnset(request.maxConcurrency)) {
    query['MaxConcurrency'] = request.maxConcurrency;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.playSleepVal)) {
    query['PlaySleepVal'] = request.playSleepVal;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.recallType)) {
    query['RecallType'] = request.recallType;
  }
  if (!Util.isUnset(request.recordPath)) {
    query['RecordPath'] = request.recordPath;
  }
  if (!Util.isUnset(request.repeatCount)) {
    query['RepeatCount'] = request.repeatCount;
  }
  if (!Util.isUnset(request.repeatInterval)) {
    query['RepeatInterval'] = request.repeatInterval;
  }
  if (!Util.isUnset(request.repeatReasonShrink)) {
    query['RepeatReason'] = request.repeatReasonShrink;
  }
  if (!Util.isUnset(request.repeatTimesShrink)) {
    query['RepeatTimes'] = request.repeatTimesShrink;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sendSmsPlanShrink)) {
    query['SendSmsPlan'] = request.sendSmsPlanShrink;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  if (!Util.isUnset(request.templateType)) {
    query['TemplateType'] = request.templateType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddTask',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建任务接口
 *
 * @param request AddTaskRequest
 * @return AddTaskResponse
 */
async function addTask(request: AddTaskRequest): AddTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return addTaskWithOptions(request, runtime);
}

model AgentCancelCallRequest {
  agentId?: long(name='AgentId', description='坐席ID', example='64'),
  agentTag?: string(name='AgentTag', description='坐席标签', example='abc'),
  numbers?: [ string ](name='Numbers', description='号码列表'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tags?: [ string ](name='Tags', description='用户自定义标签列表'),
}

model AgentCancelCallShrinkRequest {
  agentId?: long(name='AgentId', description='坐席ID', example='64'),
  agentTag?: string(name='AgentTag', description='坐席标签', example='abc'),
  numbersShrink?: string(name='Numbers', description='号码列表'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagsShrink?: string(name='Tags', description='用户自定义标签列表'),
}

model AgentCancelCallResponseBody = {
  code?: long(name='Code', example='0'),
  message?: string(name='Message', example='示例值'),
  model?: {
    unHandleNumbers?: [ string ](name='UnHandleNumbers', description='错误手机列表'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: string(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model AgentCancelCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AgentCancelCallResponseBody(name='body'),
}

/**
 * @summary 坐席取消号码外呼
 *
 * @param tmpReq AgentCancelCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AgentCancelCallResponse
 */
async function agentCancelCallWithOptions(tmpReq: AgentCancelCallRequest, runtime: Util.RuntimeOptions): AgentCancelCallResponse {
  Util.validateModel(tmpReq);
  var request = new AgentCancelCallShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.numbers)) {
    request.numbersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.numbers, 'Numbers', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentId)) {
    query['AgentId'] = request.agentId;
  }
  if (!Util.isUnset(request.agentTag)) {
    query['AgentTag'] = request.agentTag;
  }
  if (!Util.isUnset(request.numbersShrink)) {
    query['Numbers'] = request.numbersShrink;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AgentCancelCall',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 坐席取消号码外呼
 *
 * @param request AgentCancelCallRequest
 * @return AgentCancelCallResponse
 */
async function agentCancelCall(request: AgentCancelCallRequest): AgentCancelCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return agentCancelCallWithOptions(request, runtime);
}

model AgentRecoverCallRequest {
  agentId?: long(name='AgentId', description='坐席ID', example='5'),
  agentTag?: string(name='AgentTag', description='坐席标签', example='abc'),
  beginImportTime?: string(name='BeginImportTime', description='查询开始导入时间', example='2020-03-06 10:10:10'),
  endImportTime?: string(name='EndImportTime', description='查询结束导入时间', example='2021-03-06 10:10:10'),
  numbers?: [ string ](name='Numbers', description='号码列表'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tags?: [ string ](name='Tags', description='用户自定义标签列表'),
}

model AgentRecoverCallShrinkRequest {
  agentId?: long(name='AgentId', description='坐席ID', example='5'),
  agentTag?: string(name='AgentTag', description='坐席标签', example='abc'),
  beginImportTime?: string(name='BeginImportTime', description='查询开始导入时间', example='2020-03-06 10:10:10'),
  endImportTime?: string(name='EndImportTime', description='查询结束导入时间', example='2021-03-06 10:10:10'),
  numbersShrink?: string(name='Numbers', description='号码列表'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagsShrink?: string(name='Tags', description='用户自定义标签列表'),
}

model AgentRecoverCallResponseBody = {
  code?: long(name='Code', example='0'),
  message?: string(name='Message', example='示例值示例值'),
  model?: {
    unHandleNumbers?: [ string ](name='UnHandleNumbers', description='错误手机列表'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: string(name='Success', description='坐席标签', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model AgentRecoverCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AgentRecoverCallResponseBody(name='body'),
}

/**
 * @summary 坐席任务恢复号码
 *
 * @param tmpReq AgentRecoverCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AgentRecoverCallResponse
 */
async function agentRecoverCallWithOptions(tmpReq: AgentRecoverCallRequest, runtime: Util.RuntimeOptions): AgentRecoverCallResponse {
  Util.validateModel(tmpReq);
  var request = new AgentRecoverCallShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.numbers)) {
    request.numbersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.numbers, 'Numbers', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentId)) {
    query['AgentId'] = request.agentId;
  }
  if (!Util.isUnset(request.agentTag)) {
    query['AgentTag'] = request.agentTag;
  }
  if (!Util.isUnset(request.beginImportTime)) {
    query['BeginImportTime'] = request.beginImportTime;
  }
  if (!Util.isUnset(request.endImportTime)) {
    query['EndImportTime'] = request.endImportTime;
  }
  if (!Util.isUnset(request.numbersShrink)) {
    query['Numbers'] = request.numbersShrink;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AgentRecoverCall',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 坐席任务恢复号码
 *
 * @param request AgentRecoverCallRequest
 * @return AgentRecoverCallResponse
 */
async function agentRecoverCall(request: AgentRecoverCallRequest): AgentRecoverCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return agentRecoverCallWithOptions(request, runtime);
}

model DetailsRequest {
  batchId?: long(name='BatchId', description='批次id', example='75'),
  endTime?: string(name='EndTime', description='结束导入时间', example='2023-04-25 15:19:02'),
  numberStatus?: long(name='NumberStatus', description='号码状态', example='1'),
  numbers?: [ string ](name='Numbers', description='号码列表'),
  ownerId?: long(name='OwnerId'),
  pageNo?: long(name='PageNo', description='页数', example='77'),
  pageSize?: long(name='PageSize', description='每页条数

This parameter is required.', example='3'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='开始导入时间', example='2023-04-25 15:19:02'),
  taskId?: long(name='TaskId', description='任务id

This parameter is required.', example='90'),
}

model DetailsShrinkRequest {
  batchId?: long(name='BatchId', description='批次id', example='75'),
  endTime?: string(name='EndTime', description='结束导入时间', example='2023-04-25 15:19:02'),
  numberStatus?: long(name='NumberStatus', description='号码状态', example='1'),
  numbersShrink?: string(name='Numbers', description='号码列表'),
  ownerId?: long(name='OwnerId'),
  pageNo?: long(name='PageNo', description='页数', example='77'),
  pageSize?: long(name='PageSize', description='每页条数

This parameter is required.', example='3'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='开始导入时间', example='2023-04-25 15:19:02'),
  taskId?: long(name='TaskId', description='任务id

This parameter is required.', example='90'),
}

model DetailsResponseBody = {
  code?: long(name='Code', example='0'),
  message?: string(name='Message', example='示例值'),
  model?: {
    list?: [ 
      {
        batchId?: long(name='BatchId', description='批次号', example='27'),
        callDesc?: string(name='CallDesc', description='呼叫状态描述', example='示例值示例值'),
        callId?: string(name='CallId', description='外呼ID', example='28dd74a4-30ec-43c0-9bec-272924c51eeb'),
        callStatus?: long(name='CallStatus', description='呼叫状态', example='1'),
        callType?: long(name='CallType', description='外呼类型', example='2001'),
        importTime?: string(name='ImportTime', description='导入时间', example='2023-04-25 15:19:02'),
        interceptReason?: string(name='InterceptReason', description='拦截原因', example='示例值示例值示例值'),
        number?: string(name='Number', description='外呼号码', example='188******454'),
        numberDesc?: string(name='NumberDesc', description='号码状态描述', example='示例值'),
        numberMD5?: string(name='NumberMD5', description='外呼号码MD5', example='cbe1b40f76f2cca4735954886b706ffa'),
        numberStatus?: long(name='NumberStatus', description='号码状态', example='1'),
        tag?: string(name='Tag', description='用户自定义标签', example='A'),
        taskId?: long(name='TaskId', description='任务ID', example='28'),
      }
    ](name='List'),
    pageNo?: long(name='PageNo', example='100'),
    pageSize?: long(name='PageSize', example='94'),
    totalCount?: long(name='TotalCount', example='79'),
    totalPage?: float(name='TotalPage', example='71.8132'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='389b2d0a-37e2-406d-b576-1fc0827be46a'),
  success?: boolean(name='Success', example='false'),
  timestamp?: long(name='Timestamp', example='1686279332221'),
}

model DetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetailsResponseBody(name='body'),
}

/**
 * @summary AI批量任务查询号码状态接口
 *
 * @param tmpReq DetailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetailsResponse
 */
async function detailsWithOptions(tmpReq: DetailsRequest, runtime: Util.RuntimeOptions): DetailsResponse {
  Util.validateModel(tmpReq);
  var request = new DetailsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.numbers)) {
    request.numbersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.numbers, 'Numbers', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.batchId)) {
    query['BatchId'] = request.batchId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.numberStatus)) {
    query['NumberStatus'] = request.numberStatus;
  }
  if (!Util.isUnset(request.numbersShrink)) {
    query['Numbers'] = request.numbersShrink;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Details',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary AI批量任务查询号码状态接口
 *
 * @param request DetailsRequest
 * @return DetailsResponse
 */
async function details(request: DetailsRequest): DetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return detailsWithOptions(request, runtime);
}

model EditTaskRequest {
  callTimeList?: [ 
    {
      callTime?: [ string ](name='CallTime'),
    }
  ](name='CallTimeList', description='外呼时间'),
  callbackUrl?: string(name='CallbackUrl', description='回调地址', example='示例值示例值示例值'),
  flashSmsTemplateId?: long(name='FlashSmsTemplateId', description='当发送闪信配置为1时，闪信模板ID必填', example='60'),
  flashSmsType?: long(name='FlashSmsType', description='发送闪信配置,默认为0,0不发送闪信.1发送闪信', example='0'),
  maxConcurrency?: long(name='MaxConcurrency', description='并发数', example='83'),
  name?: string(name='Name', description='任务名称', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  playSleepVal?: long(name='PlaySleepVal', description='播放间隔时长', example='29'),
  playTimes?: long(name='PlayTimes', description='录音播放次数', example='60'),
  recallType?: long(name='RecallType', description='重呼配置', example='1'),
  recordPath?: string(name='RecordPath', description='录音地址', example='示例值示例值示例值'),
  repeatCount?: long(name='RepeatCount', description='重呼次数', example='51'),
  repeatInterval?: long(name='RepeatInterval', description='重呼间隔', example='91'),
  repeatReason?: [ long ](name='RepeatReason', description='重呼条件'),
  repeatTimes?: [ string ](name='RepeatTimes', description='重呼时间'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendSmsPlan?: [ 
    {
      intentTags?: [ string ](name='IntentTags', description='意向标签'),
      smsTemplateId?: long(name='SmsTemplateId', description='短信模板ID', example='1'),
    }
  ](name='SendSmsPlan', description='短信发送规则'),
  status?: long(name='Status', description='任务状态', example='2'),
  taskId?: long(name='TaskId', description='任务id

This parameter is required.', example='29'),
  templateId?: long(name='TemplateId', description='话术模板ID', example='24'),
  templateType?: long(name='TemplateType', description='话术模板类型', example='1'),
}

model EditTaskShrinkRequest {
  callTimeListShrink?: string(name='CallTimeList', description='外呼时间'),
  callbackUrl?: string(name='CallbackUrl', description='回调地址', example='示例值示例值示例值'),
  flashSmsTemplateId?: long(name='FlashSmsTemplateId', description='当发送闪信配置为1时，闪信模板ID必填', example='60'),
  flashSmsType?: long(name='FlashSmsType', description='发送闪信配置,默认为0,0不发送闪信.1发送闪信', example='0'),
  maxConcurrency?: long(name='MaxConcurrency', description='并发数', example='83'),
  name?: string(name='Name', description='任务名称', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  playSleepVal?: long(name='PlaySleepVal', description='播放间隔时长', example='29'),
  playTimes?: long(name='PlayTimes', description='录音播放次数', example='60'),
  recallType?: long(name='RecallType', description='重呼配置', example='1'),
  recordPath?: string(name='RecordPath', description='录音地址', example='示例值示例值示例值'),
  repeatCount?: long(name='RepeatCount', description='重呼次数', example='51'),
  repeatInterval?: long(name='RepeatInterval', description='重呼间隔', example='91'),
  repeatReasonShrink?: string(name='RepeatReason', description='重呼条件'),
  repeatTimesShrink?: string(name='RepeatTimes', description='重呼时间'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendSmsPlanShrink?: string(name='SendSmsPlan', description='短信发送规则'),
  status?: long(name='Status', description='任务状态', example='2'),
  taskId?: long(name='TaskId', description='任务id

This parameter is required.', example='29'),
  templateId?: long(name='TemplateId', description='话术模板ID', example='24'),
  templateType?: long(name='TemplateType', description='话术模板类型', example='1'),
}

model EditTaskResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: long(name='Code', example='0'),
  message?: string(name='Message', example='示例值示例值'),
  model?: {
    taskId?: long(name='TaskId', description='任务ID', example='92'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='5453cc9b-02bc-4dbb-9527-f28a9100b912'),
  success?: boolean(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1686225227338'),
}

model EditTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EditTaskResponseBody(name='body'),
}

/**
 * @summary 编辑任务接口
 *
 * @param tmpReq EditTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EditTaskResponse
 */
async function editTaskWithOptions(tmpReq: EditTaskRequest, runtime: Util.RuntimeOptions): EditTaskResponse {
  Util.validateModel(tmpReq);
  var request = new EditTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.callTimeList)) {
    request.callTimeListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.callTimeList, 'CallTimeList', 'json');
  }
  if (!Util.isUnset(tmpReq.repeatReason)) {
    request.repeatReasonShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.repeatReason, 'RepeatReason', 'json');
  }
  if (!Util.isUnset(tmpReq.repeatTimes)) {
    request.repeatTimesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.repeatTimes, 'RepeatTimes', 'json');
  }
  if (!Util.isUnset(tmpReq.sendSmsPlan)) {
    request.sendSmsPlanShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sendSmsPlan, 'SendSmsPlan', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.callTimeListShrink)) {
    query['CallTimeList'] = request.callTimeListShrink;
  }
  if (!Util.isUnset(request.callbackUrl)) {
    query['CallbackUrl'] = request.callbackUrl;
  }
  if (!Util.isUnset(request.flashSmsTemplateId)) {
    query['FlashSmsTemplateId'] = request.flashSmsTemplateId;
  }
  if (!Util.isUnset(request.flashSmsType)) {
    query['FlashSmsType'] = request.flashSmsType;
  }
  if (!Util.isUnset(request.maxConcurrency)) {
    query['MaxConcurrency'] = request.maxConcurrency;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.playSleepVal)) {
    query['PlaySleepVal'] = request.playSleepVal;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.recallType)) {
    query['RecallType'] = request.recallType;
  }
  if (!Util.isUnset(request.recordPath)) {
    query['RecordPath'] = request.recordPath;
  }
  if (!Util.isUnset(request.repeatCount)) {
    query['RepeatCount'] = request.repeatCount;
  }
  if (!Util.isUnset(request.repeatInterval)) {
    query['RepeatInterval'] = request.repeatInterval;
  }
  if (!Util.isUnset(request.repeatReasonShrink)) {
    query['RepeatReason'] = request.repeatReasonShrink;
  }
  if (!Util.isUnset(request.repeatTimesShrink)) {
    query['RepeatTimes'] = request.repeatTimesShrink;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sendSmsPlanShrink)) {
    query['SendSmsPlan'] = request.sendSmsPlanShrink;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  if (!Util.isUnset(request.templateType)) {
    query['TemplateType'] = request.templateType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EditTask',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 编辑任务接口
 *
 * @param request EditTaskRequest
 * @return EditTaskResponse
 */
async function editTask(request: EditTaskRequest): EditTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return editTaskWithOptions(request, runtime);
}

model ImportNumberRequest {
  customers?: [ 
    {
      clientUrl?: string(name='ClientUrl', example='http://test.com'),
      number?: string(name='Number', example='13541251222,18665214444'),
      numberMD5?: string(name='NumberMD5', example='示例值'),
      properties?: map[string]any(name='Properties', example='{"testt":"123"}'),
      tag?: string(name='Tag', example='tag1'),
    }
  ](name='Customers', description='This parameter is required.'),
  failReturn?: long(name='FailReturn', example='0'),
  outId?: string(name='OutId', description='This parameter is required.', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='92'),
}

model ImportNumberShrinkRequest {
  customersShrink?: string(name='Customers', description='This parameter is required.'),
  failReturn?: long(name='FailReturn', example='0'),
  outId?: string(name='OutId', description='This parameter is required.', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='92'),
}

model ImportNumberResponseBody = {
  code?: long(name='Code', example='0'),
  message?: string(name='Message', example='示例值示例值示例值'),
  model?: {
    batchId?: long(name='BatchId', example='54'),
    code?: long(name='Code', example='94'),
    data?: string(name='Data', example='示例值示例值'),
    importNum?: long(name='ImportNum', example='26'),
    message?: string(name='Message', example='示例值示例值示例值'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: string(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model ImportNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ImportNumberResponseBody(name='body'),
}

/**
 * @summary 导入号码
 *
 * @param tmpReq ImportNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ImportNumberResponse
 */
async function importNumberWithOptions(tmpReq: ImportNumberRequest, runtime: Util.RuntimeOptions): ImportNumberResponse {
  Util.validateModel(tmpReq);
  var request = new ImportNumberShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.customers)) {
    request.customersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.customers, 'Customers', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.customersShrink)) {
    query['Customers'] = request.customersShrink;
  }
  if (!Util.isUnset(request.failReturn)) {
    query['FailReturn'] = request.failReturn;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ImportNumber',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 导入号码
 *
 * @param request ImportNumberRequest
 * @return ImportNumberResponse
 */
async function importNumber(request: ImportNumberRequest): ImportNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return importNumberWithOptions(request, runtime);
}

model PageRequest {
  numbers?: [ string ](name='Numbers'),
  ownerId?: long(name='OwnerId'),
  pageNo?: long(name='PageNo', example='1'),
  pageSize?: long(name='PageSize', example='20'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model PageShrinkRequest {
  numbersShrink?: string(name='Numbers'),
  ownerId?: long(name='OwnerId'),
  pageNo?: long(name='PageNo', example='1'),
  pageSize?: long(name='PageSize', example='20'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model PageResponseBody = {
  code?: long(name='Code', example='0'),
  message?: string(name='Message', example='示例值示例值示例值'),
  model?: {
    list?: [ 
      {
        createTime?: string(name='CreateTime', description='添加时间', example='2020-03-06 10:10:10'),
        expirationTime?: string(name='ExpirationTime', description='过期时间', example='1'),
        number?: string(name='Number', description='手机号码', example='13314206082'),
        numberMD5?: string(name='NumberMD5', description='手机号MD5', example='e10adc3949ba59abbe56e057f20f883e'),
        remark?: string(name='Remark', description='备注', example='示例值'),
      }
    ](name='List'),
    pageNo?: long(name='PageNo', example='1'),
    pageSize?: long(name='PageSize', example='20'),
    totalCount?: long(name='TotalCount', example='97'),
    totalPage?: long(name='TotalPage', example='5'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: string(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model PageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PageResponseBody(name='body'),
}

/**
 * @summary 查询企业黑名单
 *
 * @param tmpReq PageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PageResponse
 */
async function pageWithOptions(tmpReq: PageRequest, runtime: Util.RuntimeOptions): PageResponse {
  Util.validateModel(tmpReq);
  var request = new PageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.numbers)) {
    request.numbersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.numbers, 'Numbers', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.numbersShrink)) {
    query['Numbers'] = request.numbersShrink;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Page',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询企业黑名单
 *
 * @param request PageRequest
 * @return PageResponse
 */
async function page(request: PageRequest): PageResponse {
  var runtime = new Util.RuntimeOptions{};
  return pageWithOptions(request, runtime);
}

model SmsTemplateCreateRequest {
  content?: string(name='Content', description='短信内容

This parameter is required.', example='示例值示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sign?: string(name='Sign', description='短信签名

This parameter is required.', example='ef2i29fsljf'),
  smsType?: long(name='SmsType', description='短信类型', example='73'),
  templateName?: string(name='TemplateName', description='模板名称

This parameter is required.', example='示例值示例值'),
  templateType?: long(name='TemplateType', description='模板类型', example='56'),
}

model SmsTemplateCreateResponseBody = {
  code?: long(name='Code', example='23'),
  message?: string(name='Message', example='示例值'),
  model?: string(name='Model', example='示例值示例值'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: boolean(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model SmsTemplateCreateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SmsTemplateCreateResponseBody(name='body'),
}

/**
 * @summary 短信模板创建
 *
 * @param request SmsTemplateCreateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SmsTemplateCreateResponse
 */
async function smsTemplateCreateWithOptions(request: SmsTemplateCreateRequest, runtime: Util.RuntimeOptions): SmsTemplateCreateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sign)) {
    query['Sign'] = request.sign;
  }
  if (!Util.isUnset(request.smsType)) {
    query['SmsType'] = request.smsType;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.templateType)) {
    query['TemplateType'] = request.templateType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SmsTemplateCreate',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 短信模板创建
 *
 * @param request SmsTemplateCreateRequest
 * @return SmsTemplateCreateResponse
 */
async function smsTemplateCreate(request: SmsTemplateCreateRequest): SmsTemplateCreateResponse {
  var runtime = new Util.RuntimeOptions{};
  return smsTemplateCreateWithOptions(request, runtime);
}

model SmsTemplatePageListRequest {
  ownerId?: long(name='OwnerId'),
  pageNo?: long(name='PageNo', description='页码', example='24'),
  pageSize?: long(name='PageSize', description='每页条数', example='97'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sign?: string(name='Sign', description='短信签名', example='114ah23m'),
  smsType?: long(name='SmsType', description='短信类型', example='42'),
  status?: long(name='Status', description='模板状态', example='92'),
  templateId?: long(name='TemplateId', description='模板ID', example='83'),
  templateType?: long(name='TemplateType', description='模板类型', example='19'),
}

model SmsTemplatePageListResponseBody = {
  code?: long(name='Code', example='200'),
  message?: string(name='Message', example='示例值'),
  model?: {
    list?: [ 
      {
        content?: string(name='Content', description='短信内容', example='示例值示例值示例值'),
        createTime?: string(name='CreateTime', description='创建时间', example='2021-09-26 11:34:59'),
        properties?: string(name='Properties', description='模板所需参数', example='示例值示例值'),
        shortUrlTaskId?: long(name='ShortUrlTaskId', description='智能短链ID', example='46'),
        sign?: string(name='Sign', description='短信签名', example='a234n'),
        smsType?: string(name='SmsType', description='短信类型', example='示例值示例值'),
        status?: long(name='Status', description='模板状态', example='18'),
        templateId?: long(name='TemplateId', description='模板ID', example='67'),
        templateName?: string(name='TemplateName', description='模板名称', example='示例值示例值示例值'),
        templateType?: long(name='TemplateType', description='模板类型', example='56'),
      }
    ](name='List'),
    pageNo?: long(name='PageNo', example='53'),
    pageSize?: long(name='PageSize', example='42'),
    totalCount?: long(name='TotalCount', example='2'),
    totalPage?: long(name='TotalPage', example='31'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: boolean(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model SmsTemplatePageListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SmsTemplatePageListResponseBody(name='body'),
}

/**
 * @summary 短信模板列表查询
 *
 * @param request SmsTemplatePageListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SmsTemplatePageListResponse
 */
async function smsTemplatePageListWithOptions(request: SmsTemplatePageListRequest, runtime: Util.RuntimeOptions): SmsTemplatePageListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sign)) {
    query['Sign'] = request.sign;
  }
  if (!Util.isUnset(request.smsType)) {
    query['SmsType'] = request.smsType;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  if (!Util.isUnset(request.templateType)) {
    query['TemplateType'] = request.templateType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SmsTemplatePageList',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 短信模板列表查询
 *
 * @param request SmsTemplatePageListRequest
 * @return SmsTemplatePageListResponse
 */
async function smsTemplatePageList(request: SmsTemplatePageListRequest): SmsTemplatePageListResponse {
  var runtime = new Util.RuntimeOptions{};
  return smsTemplatePageListWithOptions(request, runtime);
}

model TaskCallChatsRequest {
  agentId?: long(name='AgentId', description='坐席ID', example='72'),
  agentTag?: string(name='AgentTag', description='坐席标签', example='AA'),
  callId?: string(name='CallId', description='外呼ID

This parameter is required.', example='9b2eb6b8-7a27-4357-b5ec-104450086e24'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='任务ID', example='26'),
}

model TaskCallChatsResponseBody = {
  code?: long(name='Code', example='200'),
  message?: string(name='Message', example='示例值示例值'),
  model?: [ 
    {
      content?: string(name='Content', description='说话内容', example='示例值示例值'),
      createTime?: string(name='CreateTime', description='说话时间', example='2022-01-13 14:56:46.604'),
      fromNumber?: string(name='FromNumber', description='说话号码', example='138*****265'),
    }
  ](name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: boolean(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model TaskCallChatsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TaskCallChatsResponseBody(name='body'),
}

/**
 * @summary 查询聊天记录接口
 *
 * @param request TaskCallChatsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TaskCallChatsResponse
 */
async function taskCallChatsWithOptions(request: TaskCallChatsRequest, runtime: Util.RuntimeOptions): TaskCallChatsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentId)) {
    query['AgentId'] = request.agentId;
  }
  if (!Util.isUnset(request.agentTag)) {
    query['AgentTag'] = request.agentTag;
  }
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TaskCallChats',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询聊天记录接口
 *
 * @param request TaskCallChatsRequest
 * @return TaskCallChatsResponse
 */
async function taskCallChats(request: TaskCallChatsRequest): TaskCallChatsResponse {
  var runtime = new Util.RuntimeOptions{};
  return taskCallChatsWithOptions(request, runtime);
}

model TaskCallInfoRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='This parameter is required.', example='20'),
}

model TaskCallInfoResponseBody = {
  code?: long(name='Code', example='15'),
  message?: string(name='Message', example='示例值示例值'),
  model?: {
    finishTotal?: long(name='FinishTotal', example='75'),
    total?: long(name='Total', example='59'),
    unCallTotal?: long(name='UnCallTotal', example='3'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='示例值示例值示例值'),
  success?: boolean(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='62'),
}

model TaskCallInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TaskCallInfoResponseBody(name='body'),
}

/**
 * @summary 获取任务外呼情况接口
 *
 * @param request TaskCallInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TaskCallInfoResponse
 */
async function taskCallInfoWithOptions(request: TaskCallInfoRequest, runtime: Util.RuntimeOptions): TaskCallInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TaskCallInfo',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取任务外呼情况接口
 *
 * @param request TaskCallInfoRequest
 * @return TaskCallInfoResponse
 */
async function taskCallInfo(request: TaskCallInfoRequest): TaskCallInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return taskCallInfoWithOptions(request, runtime);
}

model TaskCallListRequest {
  batchId?: string(name='BatchId', description='导入号码时返回的批次号', example='1'),
  callDate?: string(name='CallDate', description='开始外呼时间

This parameter is required.', example='2022-01-25 00:00:00'),
  endCallDate?: string(name='EndCallDate', description='结束外呼时间

This parameter is required.', example='2022-01-25 00:00:00'),
  intentTags?: [ string ](name='IntentTags', description='意向标签'),
  numbers?: [ string ](name='Numbers', description='号码列表'),
  ownerId?: long(name='OwnerId'),
  page?: long(name='Page', description='页数

This parameter is required.', example='39'),
  pageSize?: long(name='PageSize', description='每页外呼记录数,正整数，默认10000', example='97'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='任务ID

This parameter is required.', example='93'),
}

model TaskCallListShrinkRequest {
  batchId?: string(name='BatchId', description='导入号码时返回的批次号', example='1'),
  callDate?: string(name='CallDate', description='开始外呼时间

This parameter is required.', example='2022-01-25 00:00:00'),
  endCallDate?: string(name='EndCallDate', description='结束外呼时间

This parameter is required.', example='2022-01-25 00:00:00'),
  intentTagsShrink?: string(name='IntentTags', description='意向标签'),
  numbersShrink?: string(name='Numbers', description='号码列表'),
  ownerId?: long(name='OwnerId'),
  page?: long(name='Page', description='页数

This parameter is required.', example='39'),
  pageSize?: long(name='PageSize', description='每页外呼记录数,正整数，默认10000', example='97'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='任务ID

This parameter is required.', example='93'),
}

model TaskCallListResponseBody = {
  code?: long(name='Code', example='200'),
  message?: string(name='Message', example='示例值示例值'),
  model?: {
    list?: [ 
      {
        addWx?: long(name='AddWx', description='加微', example='0'),
        addWxStatus?: string(name='AddWxStatus', description='加微进度', example='示例值示例值'),
        agentExtension?: string(name='AgentExtension', description='坐席分机', example='112'),
        agentId?: long(name='AgentId', description='坐席ID', example='87'),
        agentSpeakingDuration?: long(name='AgentSpeakingDuration', description='人工通话时长', example='98'),
        agentSpeakingTime?: string(name='AgentSpeakingTime', description='人工通话时长', example='示例值示例值'),
        agentTag?: string(name='AgentTag', description='坐席标签', example='A'),
        answerRecall?: long(name='AnswerRecall', description='是否接通重呼', example='24'),
        answerTime?: string(name='AnswerTime', description='接通时间', example='2022-01-26 18:58:25'),
        batchId?: string(name='BatchId', description='批次ID', example='1'),
        callBeginTime?: string(name='CallBeginTime', description='开始通话时间', example='2022-01-26 18:58:25'),
        callId?: string(name='CallId', description='外呼ID', example='9197ed9e-ceda-42a5-b683-823b23ef208e'),
        callTimes?: string(name='CallTimes', description='呼叫次数', example='1'),
        callType?: long(name='CallType', description='外呼类型', example='1001'),
        chatRecord?: string(name='ChatRecord', description='对话录音', example='示例值示例值'),
        gateway?: string(name='Gateway', description='外呼网关', example='123'),
        hangupTime?: string(name='HangupTime', description='挂断时间', example='2022-01-26 18:58:25'),
        hangupType?: long(name='HangupType', description='挂机方式', example='1'),
        importTime?: string(name='ImportTime', description='导入时间', example='2022-01-26 18:58:25'),
        individualTag?: string(name='IndividualTag', description='个性标签', example='A'),
        intentDescription?: string(name='IntentDescription', description='意向说明', example='示例值示例值示例值'),
        intentTag?: string(name='IntentTag', description='意向标签', example='“C”'),
        interceptReason?: string(name='InterceptReason', description='拦截原因', example='示例值'),
        keywords?: string(name='Keywords', description='回复关键词', example='示例值示例值'),
        number?: string(name='Number', description='外呼号码', example='138*****123'),
        numberMD5?: string(name='NumberMD5', description='外呼号码MD5', example='75916b635568954583783d'),
        properties?: string(name='Properties', description='参数', example='示例值示例值'),
        remark?: string(name='Remark', description='备注', example='示例值示例值'),
        ringTime?: long(name='RingTime', description='振铃时长', example='66'),
        sms?: string(name='Sms', description='挂机短信', example='示例值'),
        speakingDuration?: long(name='SpeakingDuration', description='AI通话时长', example='45'),
        speakingTime?: string(name='SpeakingTime', description='AI通话时长', example='示例值示例值示例值'),
        speakingTurns?: string(name='SpeakingTurns', description='对话轮次', example='0'),
        status?: string(name='Status', description='外呼状态', example='示例值示例值示例值'),
        statusCode?: long(name='StatusCode', description='外呼状态编码', example='1'),
        statusDescription?: string(name='StatusDescription', description='外呼状态描述', example='示例值示例值'),
        tag?: string(name='Tag', description='用户自定义标签', example='示例值'),
        taskId?: long(name='TaskId', description='外呼任务ID', example='70'),
        templateId?: long(name='TemplateId', description='AI话术ID', example='66'),
        transferStatus?: string(name='TransferStatus', description='转人工状态', example='示例值'),
        transferStatusCode?: long(name='TransferStatusCode', description='转人工状态编码', example='1'),
      }
    ](name='List'),
    pageNo?: long(name='PageNo', example='62'),
    pageSize?: long(name='PageSize', example='95'),
    totalCount?: long(name='TotalCount', example='80'),
    totalPage?: long(name='TotalPage', example='39'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: string(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model TaskCallListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TaskCallListResponseBody(name='body'),
}

/**
 * @summary AI批量任务查询外呼记录接口
 *
 * @param tmpReq TaskCallListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TaskCallListResponse
 */
async function taskCallListWithOptions(tmpReq: TaskCallListRequest, runtime: Util.RuntimeOptions): TaskCallListResponse {
  Util.validateModel(tmpReq);
  var request = new TaskCallListShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.intentTags)) {
    request.intentTagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.intentTags, 'IntentTags', 'json');
  }
  if (!Util.isUnset(tmpReq.numbers)) {
    request.numbersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.numbers, 'Numbers', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.batchId)) {
    query['BatchId'] = request.batchId;
  }
  if (!Util.isUnset(request.callDate)) {
    query['CallDate'] = request.callDate;
  }
  if (!Util.isUnset(request.endCallDate)) {
    query['EndCallDate'] = request.endCallDate;
  }
  if (!Util.isUnset(request.intentTagsShrink)) {
    query['IntentTags'] = request.intentTagsShrink;
  }
  if (!Util.isUnset(request.numbersShrink)) {
    query['Numbers'] = request.numbersShrink;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TaskCallList',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary AI批量任务查询外呼记录接口
 *
 * @param request TaskCallListRequest
 * @return TaskCallListResponse
 */
async function taskCallList(request: TaskCallListRequest): TaskCallListResponse {
  var runtime = new Util.RuntimeOptions{};
  return taskCallListWithOptions(request, runtime);
}

model TaskCancelCallRequest {
  numbers?: [ string ](name='Numbers'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tags?: [ string ](name='Tags'),
  taskId?: long(name='TaskId', description='任务ID

This parameter is required.', example='30'),
}

model TaskCancelCallShrinkRequest {
  numbersShrink?: string(name='Numbers'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagsShrink?: string(name='Tags'),
  taskId?: long(name='TaskId', description='任务ID

This parameter is required.', example='30'),
}

model TaskCancelCallResponseBody = {
  code?: string(name='Code', example='0'),
  message?: string(name='Message', example='示例值示例值'),
  model?: {
    unHandleNumbers?: [ string ](name='UnHandleNumbers', description='错误手机号'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: string(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model TaskCancelCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TaskCancelCallResponseBody(name='body'),
}

/**
 * @summary 批量任务取消号码外呼
 *
 * @param tmpReq TaskCancelCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TaskCancelCallResponse
 */
async function taskCancelCallWithOptions(tmpReq: TaskCancelCallRequest, runtime: Util.RuntimeOptions): TaskCancelCallResponse {
  Util.validateModel(tmpReq);
  var request = new TaskCancelCallShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.numbers)) {
    request.numbersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.numbers, 'Numbers', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.numbersShrink)) {
    query['Numbers'] = request.numbersShrink;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TaskCancelCall',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 批量任务取消号码外呼
 *
 * @param request TaskCancelCallRequest
 * @return TaskCancelCallResponse
 */
async function taskCancelCall(request: TaskCancelCallRequest): TaskCancelCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return taskCancelCallWithOptions(request, runtime);
}

model TaskListRequest {
  createTime?: string(name='CreateTime', description='创建时间', example='2023-04-05 12:11:11'),
  lastCallTime?: string(name='LastCallTime', description='最后外呼时间', example='2023-04-05 12:11:11'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: long(name='Status', description='任务状态。1 未启用，2 启用中，4 已停止', example='2'),
  taskId?: long(name='TaskId', description='任务ID', example='2'),
}

model TaskListResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: long(name='Code', example='30'),
  message?: string(name='Message', example='示例值示例值示例值'),
  model?: [ 
    {
      allowCallTime?: string(name='AllowCallTime', description='外呼时间段', example='“8:00~20:30”'),
      allowCallTimeFormat?: string(name='AllowCallTimeFormat', description='外呼时间段格式化', example='“8:00 ~ 20:00”'),
      allowDayOfWeek?: string(name='AllowDayOfWeek', description='外呼时间', example='“1,2,3”'),
      callType?: long(name='CallType', description='外呼类型', example='95'),
      createTime?: string(name='CreateTime', description='创建时间', example='2023-04-05 12:11:11'),
      flashSmsTemplateId?: long(name='FlashSmsTemplateId', description='闪信模板id', example='99'),
      flashSmsTemplateName?: string(name='FlashSmsTemplateName', description='闪信模板名称', example='示例值示例值示例值'),
      flashSmsType?: long(name='FlashSmsType', description='发送闪信配置，可选0，1；0表示否，1表示是', example='1'),
      importTime?: string(name='ImportTime', description='最近导入时间', example='2023-04-05 12:11:11'),
      intentTags?: [ 
        {
          intentDescription?: string(name='IntentDescription', description='意向标签描述', example='示例值示例值'),
          intentTag?: string(name='IntentTag', description='意向标签ID', example='示例值示例值'),
        }
      ](name='IntentTags', description='意向标签列表'),
      invalidReCall?: long(name='InvalidReCall', description='接通重呼次数', example='31'),
      lastCallTime?: string(name='LastCallTime', description='最后外呼时间', example='2023-04-05 12:11:11'),
      maxConcurrency?: long(name='MaxConcurrency', description='最大并发数', example='95'),
      personalityTags?: [ string ](name='PersonalityTags', description='个性标签列表'),
      priority?: long(name='Priority', description='优先任务', example='66'),
      properties?: string(name='Properties', description='任务所需参数', example='示例值示例值'),
      recallType?: long(name='RecallType', description='自动重呼', example='20'),
      sendSms?: long(name='SendSms', description='发送短信', example='39'),
      smsName?: string(name='SmsName', description='短信模板', example='示例值示例值'),
      status?: long(name='Status', description='任务状态', example='79'),
      taskId?: long(name='TaskId', description='任务ID', example='68'),
      taskName?: string(name='TaskName', description='任务名称', example='示例值示例值'),
      templateId?: string(name='TemplateId', description='话术模板Id', example='示例值示例值示例值'),
      templateName?: string(name='TemplateName', description='话术模板名称', example='示例值示例值'),
    }
  ](name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: boolean(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='80'),
}

model TaskListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TaskListResponseBody(name='body'),
}

/**
 * @summary 查询任务列表接口
 *
 * @param request TaskListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TaskListResponse
 */
async function taskListWithOptions(request: TaskListRequest, runtime: Util.RuntimeOptions): TaskListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.createTime)) {
    query['CreateTime'] = request.createTime;
  }
  if (!Util.isUnset(request.lastCallTime)) {
    query['LastCallTime'] = request.lastCallTime;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TaskList',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询任务列表接口
 *
 * @param request TaskListRequest
 * @return TaskListResponse
 */
async function taskList(request: TaskListRequest): TaskListResponse {
  var runtime = new Util.RuntimeOptions{};
  return taskListWithOptions(request, runtime);
}

model TaskRecoverCallRequest {
  beginImportTime?: string(name='BeginImportTime', description='查询开始导入时间', example='"2023-01-09 18:58:19"'),
  endImportTime?: string(name='EndImportTime', description='查询结束导入时间', example='"2023-01-09 18:58:19"'),
  numbers?: [ string ](name='Numbers', description='号码列表'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tags?: [ string ](name='Tags', description='用户自定义标签列表'),
  taskId?: long(name='TaskId', description='任务ID

This parameter is required.', example='93'),
}

model TaskRecoverCallShrinkRequest {
  beginImportTime?: string(name='BeginImportTime', description='查询开始导入时间', example='"2023-01-09 18:58:19"'),
  endImportTime?: string(name='EndImportTime', description='查询结束导入时间', example='"2023-01-09 18:58:19"'),
  numbersShrink?: string(name='Numbers', description='号码列表'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagsShrink?: string(name='Tags', description='用户自定义标签列表'),
  taskId?: long(name='TaskId', description='任务ID

This parameter is required.', example='93'),
}

model TaskRecoverCallResponseBody = {
  code?: long(name='Code', example='0'),
  message?: string(name='Message', example='示例值'),
  model?: map[string]any(name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: string(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model TaskRecoverCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TaskRecoverCallResponseBody(name='body'),
}

/**
 * @summary 批量任务恢复号码
 *
 * @param tmpReq TaskRecoverCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TaskRecoverCallResponse
 */
async function taskRecoverCallWithOptions(tmpReq: TaskRecoverCallRequest, runtime: Util.RuntimeOptions): TaskRecoverCallResponse {
  Util.validateModel(tmpReq);
  var request = new TaskRecoverCallShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.numbers)) {
    request.numbersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.numbers, 'Numbers', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'Tags', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.beginImportTime)) {
    query['BeginImportTime'] = request.beginImportTime;
  }
  if (!Util.isUnset(request.endImportTime)) {
    query['EndImportTime'] = request.endImportTime;
  }
  if (!Util.isUnset(request.numbersShrink)) {
    query['Numbers'] = request.numbersShrink;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    query['Tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TaskRecoverCall',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 批量任务恢复号码
 *
 * @param request TaskRecoverCallRequest
 * @return TaskRecoverCallResponse
 */
async function taskRecoverCall(request: TaskRecoverCallRequest): TaskRecoverCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return taskRecoverCallWithOptions(request, runtime);
}

model TemplateListRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  templateId?: long(name='TemplateId', description='必须空参', example='9'),
}

model TemplateListResponseBody = {
  code?: long(name='Code', example='200'),
  message?: string(name='Message', example='示例值示例值'),
  model?: [ 
    {
      intentTags?: [  map[string]any ](name='IntentTags', description='意向标签'),
      personalityTags?: [ string ](name='PersonalityTags', description='个性标签'),
      properties?: string(name='Properties', description='话术所需参数', example='示例值示例值'),
      templateId?: long(name='TemplateId', description='AI话术ID', example='59'),
      templateName?: string(name='TemplateName', description='话术模板名称', example='示例值示例值'),
      templateType?: long(name='TemplateType', description='模板类型', example='55'),
    }
  ](name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: boolean(name='Success', example='false'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model TemplateListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TemplateListResponseBody(name='body'),
}

/**
 * @summary 话术模板列表查询接口
 *
 * @param request TemplateListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TemplateListResponse
 */
async function templateListWithOptions(request: TemplateListRequest, runtime: Util.RuntimeOptions): TemplateListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TemplateList',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 话术模板列表查询接口
 *
 * @param request TemplateListRequest
 * @return TemplateListResponse
 */
async function templateList(request: TemplateListRequest): TemplateListResponse {
  var runtime = new Util.RuntimeOptions{};
  return templateListWithOptions(request, runtime);
}

model UpdateAgentStatusRequest {
  agentId?: long(name='AgentId', description='坐席ID', example='58'),
  agentStatus?: long(name='AgentStatus', description='坐席状态 1:在线；2:忙碌；3:小休；4:离线', example='1'),
  agentTag?: string(name='AgentTag', description='坐席标签', example='abac'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model UpdateAgentStatusResponseBody = {
  code?: long(name='Code', example='0'),
  message?: string(name='Message', example='示例值示例值示例值'),
  model?: map[string]any(name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: string(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model UpdateAgentStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAgentStatusResponseBody(name='body'),
}

/**
 * @summary 修改坐席状态
 *
 * @param request UpdateAgentStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAgentStatusResponse
 */
async function updateAgentStatusWithOptions(request: UpdateAgentStatusRequest, runtime: Util.RuntimeOptions): UpdateAgentStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentId)) {
    query['AgentId'] = request.agentId;
  }
  if (!Util.isUnset(request.agentStatus)) {
    query['AgentStatus'] = request.agentStatus;
  }
  if (!Util.isUnset(request.agentTag)) {
    query['AgentTag'] = request.agentTag;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAgentStatus',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改坐席状态
 *
 * @param request UpdateAgentStatusRequest
 * @return UpdateAgentStatusResponse
 */
async function updateAgentStatus(request: UpdateAgentStatusRequest): UpdateAgentStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAgentStatusWithOptions(request, runtime);
}

model UpdateTaskCustomerRequest {
  customers?: [ 
    {
      cancel?: long(name='Cancel', description='是否取消外呼 0否，1是', example='0'),
      number?: string(name='Number', description='电话号码', example='13661109390'),
      properties?: map[string]any(name='Properties', description='需根据具体任务参数要求传输', example='{"test":"234"}'),
      tag?: string(name='Tag', description='用户自定义标签', example='tag1'),
    }
  ](name='Customers', description='外呼客户

This parameter is required.'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='任务ID

This parameter is required.', example='59'),
}

model UpdateTaskCustomerShrinkRequest {
  customersShrink?: string(name='Customers', description='外呼客户

This parameter is required.'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='任务ID

This parameter is required.', example='59'),
}

model UpdateTaskCustomerResponseBody = {
  code?: long(name='Code', example='0'),
  message?: string(name='Message', example='示例值示例值'),
  model?: {
    unHandleNumbers?: [ string ](name='UnHandleNumbers', description='错误手机列表'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='8EFC6D10-307B-1ECA-A8C6-7CBDF776AAD2'),
  success?: string(name='Success', example='true'),
  timestamp?: long(name='Timestamp', example='1683440860035'),
}

model UpdateTaskCustomerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTaskCustomerResponseBody(name='body'),
}

/**
 * @summary 更新当天导入的号码
 *
 * @param tmpReq UpdateTaskCustomerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTaskCustomerResponse
 */
async function updateTaskCustomerWithOptions(tmpReq: UpdateTaskCustomerRequest, runtime: Util.RuntimeOptions): UpdateTaskCustomerResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateTaskCustomerShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.customers)) {
    request.customersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.customers, 'Customers', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.customersShrink)) {
    query['Customers'] = request.customersShrink;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateTaskCustomer',
    version = '2023-05-16',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新当天导入的号码
 *
 * @param request UpdateTaskCustomerRequest
 * @return UpdateTaskCustomerResponse
 */
async function updateTaskCustomer(request: UpdateTaskCustomerRequest): UpdateTaskCustomerResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateTaskCustomerWithOptions(request, runtime);
}

